#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long Ull;
int main()
{
	int t=0;
	cin>>t;
	int n=0;
	while(t--)
	{
		int ans=0;
		cin>>n;
		if(n>=13)
		{
			ans+=n/13*6;
			int r=n%13;
			if(r>=11)
			{
				ans+=6;
			}
			else if(r>=8)
			{
				ans+=5;
			}
			else if(r>=5)
			{
				ans+=4;
			}
			else if(r>=4)
			{
				ans+=3;
			}
			else if(r>=2)
			{
				ans+=2;
			}
			else if(r>=1) ans+=1;
			cout<<ans<<endl;
		}
		else
		{
			if(n<11 && n>=5)
			{
				cout<<5<<endl;
			}
			else if(n>=0 && n<5)
			{
				cout<<n<<endl;
			}
			else
			{
				cout<<6<<endl;
			}
		}
	}

	return 0;
}

